<?php
/**
 * <https://y.st./>
 * Copyright © 2017 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'title' => 'Compromises in code',
	'body' => <<<END
<section id="general">
	<h2>General news</h2>
	<p>
		As I was heading out the door to go to work, I was rummaging through some stuff and found a certificate from the $a[HIV] Alliance.
		It offers a gift card to people identifying as men that have sex with men if they take a gratis $a[HIV] test at their Eugene office.
		I was thinking it&apos;d be easy money.
		It wouldn&apos;t be worth the time and energy to bike out there for it, but it&apos;d be a nice excuse for some exercise as long as I admit the money&apos;s not the main reason for going.
		But then I realised that I don&apos;t qualify.
		I don&apos;t identify as a man, but even changing that to males that have sex with males ... I&apos;m a virgin.
		I&apos;m hella gay, but I don&apos;t have sex with <strong>*anyone*</strong> yet.
		It strikes me as peculiar that I&apos;m a gay male, but I&apos;m not a male that has sex with males.
		It makes perfect sense, but it still feels almost paradoxical.
	</p>
	<p>
		My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
	</p>
</section>
<section id="include.d">
	<h2><a href="https://git.volatile.ch./y.st./include.d/releases">include.d</a></h2>
	<p>
		I hit a bit of an issue while trying to set up the type-hinting for my code.
		When functions and methods are not supposed to return a value, this can&apos;t be enforced.
		I&apos;m going to need to rewrite my functions and methods to always return a value of some sort.
		If there&apos;s no possible helpful value to return, I guess I&apos;ll return a constant boolean or something.
		A bit after finding this limitation, I found that it was actually fixed in a later version of $a[PHP].
		That&apos;ll definitely help with future code, but it won&apos;t help now.
		I develop for the version of $a[PHP] that ships with Debian Stable for greatest compatibility.
		I can&apos;t make use of this fix just yet, and by the time I can, my rewrite should be long past complete.
	</p>
	<p>
		A few methods in one of my wrapper classes can&apos;t be fully updated to make use of the type hinting, and won&apos;t be able to even with the later update.
		One takes a value as a parameter that can be either a string or an integer.
		Another returns a value that can be a string, an integer, or a boolean.
		I could break these methods into multiple methods, but I&apos;m reluctant to do that.
		The class is just supposed to act as a thin wrapper, binding a resource handle to the functions that operate on it.
		A third method requires an object as an argument, but that object may be of any class.
		I can&apos;t type hint for general objects.
		Similar issues were present in my other wrapper class as well.
		I think I&apos;ll just leave the new feature use out here.
		I fully intend to update all my non-wrapper classes to conform to the strict type-hinting though.
	</p>
	<p>
		That is, at least when not implementing built-in interfaces or providing callbacks for built-in functions.
		It seems that when implementing an interface that doesn&apos;t make use of type-hinting, parameters can&apos;t be type-hinted.
		I don&apos;t have a way around that.
		Also, some callback functions need to accept a resource handle as an argument.
		That can&apos;t be type-hinted for either.
	</p>
	<p>
		I&apos;ve finished up pretty much all the update, with the exception of the $a[URI]-handling code.
		That code&apos;s a bit complex, and, as I said before, the documentation on it&apos;s out of date.
		I thought I&apos;d finished up the code of the main abstract class, but then I got to the main class that descends from it.
		The main issue there is that the return value types have been changed in several key methods.
		I&apos;ll need to finish updating this class, then go back and fix up the abstract class to allow the child class to even descend from it.
		Then there&apos;s the fact that I can&apos;t enforce null return values, so I need to alter the code to provide reasonable return values where possible.
		Several methods operated on arrays without copying them, but to provide decent return values, that&apos;ll need to change.
		Passes by reference will need to be removed, and code that called those methods restructured.
		It&apos;ll take some time, that&apos;s for sure.
		And once it&apos;s all complete, I&apos;ll need to go through the documentation and finish updating it.
	</p>
</section>
END
);
